# -*-coding:utf-8-*-
from django.urls import path, re_path
from api.views import login, article, comment, mood, user, file, api_send_email, history, admin_data

urlpatterns = [
    path('login/', login.LoginView.as_view()),
    path('register/', login.RegisterView.as_view()),
    path('article/', article.ArticleView.as_view()),
    re_path(r'article/(?P<nid>\d+)', article.ArticleView.as_view()),

    re_path(r'article_pwd/(?P<nid>\d+)', article.ArticlePwdView.as_view()),  # 查看加密文章

    re_path(r'article/comment/(?P<nid>\d+)/', comment.CommentView.as_view()),  # 发布评论
    re_path(r'comment/digg/(?P<nid>\d+)/', comment.CommentDiggView.as_view()),  # 评论点赞

    re_path(r'article/digg/(?P<nid>\d+)/', article.ArticleDiggView.as_view()),  # 文章点赞
    re_path(r'article/collects/(?P<nid>\d+)/', article.ArticleCollectViews.as_view()),  # 文章收藏

    path('moods/', mood.MoodsView.as_view()),  # 发布心情
    re_path(r'moods/(?P<nid>\d+)/', mood.MoodsView.as_view()),  # 删除心情
    re_path(r'mood_comments/(?P<nid>\d+)/', mood.MoodCommentsView.as_view()),  # 发布心情评论

    path('edit_password/', user.EditPasswordView.as_view()),  # 修改密码
    path('edit_avatar/', user.EditAvatarView.as_view()),  # 修改头像

    path('upload/avatar/', file.AvatarView.as_view()),  # 上传头像
    path('upload/cover/', file.CoverView.as_view()),  # 上传封面像
    re_path(r'upload/avatar/(?P<nid>\d+)/', file.AvatarView.as_view()),  # 文件删除
    re_path(r'upload/cover/(?P<nid>\d+)/', file.CoverView.as_view()),  # 封面删除
    path(r'send_email/', api_send_email.Api_send_email.as_view()),  # 发送邮件
    path(r'perfect_information/', user.EditUserInfo.as_view()),  # 发送邮件

    path('cancle_collection/', user.CancleCollection.as_view()),  # 取消收藏

    path('paste_upload/', file.PasteUploadView.as_view()),  # 粘贴图片

    path('history/', history.HistoryView.as_view()),  # 发布心情
    re_path(r'history/(?P<nid>\d+)/', history.HistoryView.as_view()),  # 编辑记录

    path('feedback/', user.FeedBackView.as_view()),  # 意见反馈

    path('get_online/', admin_data.get_online),  # 获取在线人数

    path('get_seven_date/',admin_data.get_seven_date),


]
